fix: prevent duplicated codebase indexing on VSCode restart #5942
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes issue #5941 where the codebase was being re-indexed every time VSCode was restarted, even when a valid index already existed.
Problem
The code indexing system was not checking if an existing index with data was already present before starting a full re-index on every VSCode restart. This caused unnecessary CPU usage and delays for users.
Solution
hasData()method to theIVectorStoreinterface to check if the collection contains any indexed dataChanges
hasData()method toIVectorStoreinterfacehasData()inQdrantVectorStoreto check collection point countCodeIndexOrchestrator.startIndexing()to skip full scan if valid data existsCodeIndexManager.initialize()to better handle existing indexeshasData()methodTesting
Fixes #5941
Important
Fixes issue #5941 by preventing unnecessary codebase re-indexing on VSCode restart through checking existing index data.
CodeIndexOrchestrator.startIndexing()skips full scan if valid data exists.CodeIndexManager.initialize()only triggers indexing when necessary.hasData()method toIVectorStoreinterface.hasData()inQdrantVectorStoreto check collection point count.hasData()method.This description was created by
for da4c8ec. You can customize this summary. It will automatically update as commits are pushed.